package pck.ivrGraph.forms;

import javax.swing.*;
import java.awt.*;

public class AlertForm extends JFrame{
	public AlertForm(Exception e){
		super();
		JTextArea textField = new JTextArea();
		textField.setAutoscrolls(true);
		StackTraceElement[] stackTrace = e.getStackTrace();
		String printString = e.getMessage() + "\n";
		for (int i = 0; i < stackTrace.length; i++){
			printString = printString + stackTrace[i].toString() + "\n";
		}
		textField.setText(printString);
		textField.setForeground(Color.red);
		textField.setMargin(new Insets(15,15,15,15));
		this.getContentPane().add(textField);
		this.setResizable(false);
		this.pack();
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setVisible(true);
	}
}
